﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DHQGHN.DAL.DAO.Admin;
using DHQGHN.DAL.Models.Admin;

namespace DHQGHN.DAL.BO.Admin
{
    public class ActionNameBO : BaseBO
    {
        private string _connectionString;
        public ActionNameBO(string connString)
        {
            this._connectionString = connString;
        }

        public ActionNameBO()
        {
            this._connectionString = Common.ConnectionUtil.DHQG_ADMIN_CONNECTION_STRING;
        }

        public List<ActionNameModel> GetListActionName(string userName, string appId)
        {
            try
            {
                ActionNameDAO objDAO = new ActionNameDAO(this._connectionString, DEFAULT_MAPPER_TYPE);
                Dictionary<string, string> mapDictionary = this.GetMapDictionary();
                return objDAO.GetListActionName(userName, appId, mapDictionary);
            }
            catch
            {
                throw;
            }
        }

        private Dictionary<string, string> GetMapDictionary()
        {
            Dictionary<string, string> mapDictionary = new Dictionary<string, string>();
            mapDictionary.Add("ActionId", "ActionID");
            mapDictionary.Add("ActionName", "Actionname");
            mapDictionary.Add("AppId", "AppId");

            return mapDictionary;
        }
    }
}
